/*
 * To change this template, choose Tools | Templates and open the template in
 * the editor.
 */

/*
 * MenuForm.java
 *
 * Created on 07/02/2011, 12:16:04 PM
 */
package org.gingresos.start;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyVetoException;
import java.beans.VetoableChangeListener;
import javax.swing.JInternalFrame;
import javax.swing.UIManager;
import javax.swing.plaf.synth.SynthLookAndFeel;
import org.gingresos.contabilidad.ContabilidadInformeDiario;
import org.gingresos.contabilidad.ContabilidadInformeDiarioGrupo;
import org.gingresos.contabilidad.ContabilidadInformeDiarioSubGrupo;
import org.gingresos.contabilidad.ContabilidadInformeGeneral;
import org.gingresos.contabilidad.morosidad.MorosidadComerciosListado;
import org.gingresos.contabilidad.morosidad.MorosidadContribuyentesListado;
import org.gingresos.importartablas.*;
import org.gingresosapi.beans.*;
import org.gingresosapi.controller.*;
import org.gingresosapi.generales.Mensajeria;
import org.gingresos.menu.MenuBeans;
import org.gingresos.recibos.RecibosReimprimir;
import org.gingresos.regimenimpositivo.CargarIngresos;
import org.gingresos.regimenimpositivo.CargarRegimenImpositivo;
import org.gingresos.regimenimpositivo.DefinirIngresosTributarios;
import org.gingresos.regimenimpositivo.GrupoRegimenListar;
import org.gingresos.regimenimpositivo.RegimenListar;
import org.gingresos.regimenimpositivo.SubgrupoRegimenListar;
import org.gingresos.servidoringresos.ServidorIngresosCrear;
import org.gingresos.servidoringresos.ServidorIngresosListar;
import org.gingresos.vehiculos.VehiculosReeimprimirCertificacion;
import org.gingresosapi.generales.DataGManager;
import org.ingresos.contribuyentes.ContribuyentesRegistros;

/**
 *
 * @author avbravo
 */
public class MenuForm extends javax.swing.JFrame {

    DataGManager dataGManager = new DataGManager();
    Encriptador encriptador = new Encriptador();
    MenuBeans menuBeans1;
    Usuarios usuarios1;
    UsuariosController usuariosController1;
    int x, y;
    int screenHeight;
    int screenWidth;
    private IconPolice iconPolice = new IconPolice();

    /**
     * Creates new form MenuForm
     */
    public MenuForm() {
        initComponents();
        try {
            //UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            for (UIManager.LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(laf.getName())) {
                    UIManager.setLookAndFeel(laf.getClassName());
                    SynthLookAndFeel.setStyleFactory(
                            new MySynthStyleFactory(SynthLookAndFeel.getStyleFactory()));
                    break;
                }
            }

        } catch (Exception e) {
            e.printStackTrace();
        }
        menuBeans1 = new MenuBeans();
        usuarios1 = new Usuarios();
        usuariosController1 = new UsuariosController();



        jMenuBar1.setEnabled(false);
        jMenuBar1.setVisible(false);

        /*
         * Central JInternalFrame
         */
        Toolkit tk = Toolkit.getDefaultToolkit();
        Dimension screenSize = tk.getScreenSize();
        this.screenHeight = screenSize.height;
        this.screenWidth = screenSize.width;
        this.x = (int) (this.screenWidth / 4.0);

        //   this.y =(int) (this.screenHeight / 4.0);
        this.y = 1;
        //
        jInternalFrameLogin.setVisible(true);
        jInternalFrameLogin.setLocation(x, y);
        jInternalFrameUsuario.setVisible(false);
    
        jLabelVersionNumeroVersion.setText(MySesion.getVersion());
        jLabelVersionNumeroVersionUsuario.setText("Version: " + MySesion.getVersion());

        jTextFieldUsername.requestFocus();
        jTextField1.setText(MySesion.Version);
        try {

            dataGManager.OpenConnection();
        } catch (Exception e) {
            Mensajeria.MensajeError(e, "init()");
        }

    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jDesktopPane1 = new javax.swing.JDesktopPane();
        jInternalFrameUsuario = new javax.swing.JInternalFrame();
        jPanel2 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabelUsername = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabelIdMunicipio = new javax.swing.JLabel();
        jLabelVersionNumeroVersionUsuario = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jToolBar2 = new javax.swing.JToolBar();
        jButtonUpdateVersion1 = new javax.swing.JButton();
        jButtonBackup1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jLabel9 = new javax.swing.JLabel();
        jInternalFrameLogin = new javax.swing.JInternalFrame();
        jPanel3 = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        jSeparator3 = new javax.swing.JSeparator();
        jLabel5 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jTextFieldUsername = new javax.swing.JTextField();
        jPasswordField1 = new javax.swing.JPasswordField();
        jLabel7 = new javax.swing.JLabel();
        jLabelVersionNumeroVersion = new javax.swing.JLabel();
        jButtonEntrar = new javax.swing.JButton();
        jButtonSalir = new javax.swing.JButton();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenuContribuyentes = new javax.swing.JMenu();
        jMenuItemContribuyentesRegistros = new javax.swing.JMenuItem();
        jMenuItemSalir = new javax.swing.JMenuItem();
        jMenu1 = new javax.swing.JMenu();
        jMenuItemRecibosReeimprimir = new javax.swing.JMenuItem();
        jMenuContabilidad = new javax.swing.JMenu();
        jMenuContabilidadIngresos = new javax.swing.JMenu();
        jMenuItemContabilidadIngresosDiarios = new javax.swing.JMenuItem();
        jMenuItemContabilidadInformeDiarioSubgrupo = new javax.swing.JMenuItem();
        jMenuItemContabilidadInformeDiarioGrupo = new javax.swing.JMenuItem();
        jMenuItemContabilidadInformeGeneral = new javax.swing.JMenuItem();
        jMenuContabilidadMorosidad = new javax.swing.JMenu();
        jMenuItemContabilidadMorosidadListadoComercios = new javax.swing.JMenuItem();
        jMenuItemContabilidadMorosidadListadoContribuyentes = new javax.swing.JMenuItem();
        jMenuVehiculos = new javax.swing.JMenu();
        jMenuVehiculosReeimpresion = new javax.swing.JMenu();
        jMenuItemVehiculosReempresionCertificacion = new javax.swing.JMenuItem();
        jMenuAdministracion = new javax.swing.JMenu();
        jMenuServidorIngresos = new javax.swing.JMenu();
        jMenuItemServidorIngresosConsultar = new javax.swing.JMenuItem();
        jMenuItemServidorIngresosConfigurar = new javax.swing.JMenuItem();
        jMenuItemImportarTablasIngreso = new javax.swing.JMenuItem();
        jMenuPresupuestoMain = new javax.swing.JMenu();
        jMenuRegimenImpositivo = new javax.swing.JMenu();
        jMenuItemCargarRegimenImpositivo = new javax.swing.JMenuItem();
        jMenuGrupoRegimen = new javax.swing.JMenu();
        jMenuItemGrupoRegimenListar = new javax.swing.JMenuItem();
        jMenuItemGrupoRegimenEliminar = new javax.swing.JMenuItem();
        jMenuSubGrupoRegimen = new javax.swing.JMenu();
        jMenuItemSubGrupoRegimenListar = new javax.swing.JMenuItem();
        jMenuItemSubGrupoRegimenEliminar = new javax.swing.JMenuItem();
        jMenuRegimen = new javax.swing.JMenu();
        jMenuItemRegimenListar = new javax.swing.JMenuItem();
        jMenuItemRegimenEliminar = new javax.swing.JMenuItem();
        jMenuItemDefinirIngresosTributarios = new javax.swing.JMenuItem();
        jMenuImportarIngresos = new javax.swing.JMenu();
        jMenuItem22 = new javax.swing.JMenuItem();
        jMenuRecibos = new javax.swing.JMenu();
        jMenuItemRecibosListar = new javax.swing.JMenuItem();
        jMenuDetallesRecibos = new javax.swing.JMenu();
        jMenuItemDetallesRecibosListar = new javax.swing.JMenuItem();
        jMenuItemImportarVehiculos = new javax.swing.JMenuItem();
        jMenuItemImportarContribuyentes = new javax.swing.JMenuItem();
        jMenuItemImportarComercios = new javax.swing.JMenuItem();
        jMenuItemCertificacionVehicular = new javax.swing.JMenuItem();
        jMenuDevelopment = new javax.swing.JMenu();
        jMenuItemLimpiarTablas = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("SISTEMA DE GESTION DE INGRESOS MUNICIPALES");
        setExtendedState(4);

        jDesktopPane1.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        jInternalFrameUsuario.setClosable(true);
        jInternalFrameUsuario.setMaximizable(true);
        jInternalFrameUsuario.setResizable(true);
        jInternalFrameUsuario.setTitle("Usuario");
        jInternalFrameUsuario.setVisible(true);

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Usuario"));

        jLabel1.setText("Usuario");

        jLabelUsername.setText("jLabel2");

        jLabel3.setText("Institucion");

        jLabelIdMunicipio.setText("jLabel5");

        jLabelVersionNumeroVersionUsuario.setText("0.1.0");

        jLabel8.setText("Version");

        jTextField1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel3)
                    .addComponent(jLabel1)
                    .addComponent(jLabel8))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelVersionNumeroVersionUsuario, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabelUsername)
                    .addComponent(jLabelIdMunicipio))
                .addGap(18, 18, 18)
                .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(24, 24, 24))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jLabelUsername))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jLabelIdMunicipio))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 13, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(jLabelVersionNumeroVersionUsuario)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

        jToolBar2.setRollover(true);

        jButtonUpdateVersion1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gingresos/resources/gif/updateversion.png"))); // NOI18N
        jButtonUpdateVersion1.setToolTipText("Actualizar Sistema");
        jButtonUpdateVersion1.setFocusable(false);
        jButtonUpdateVersion1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButtonUpdateVersion1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButtonUpdateVersion1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonUpdateVersion1ActionPerformed(evt);
            }
        });
        jToolBar2.add(jButtonUpdateVersion1);

        jButtonBackup1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gingresos/resources/gif/backup.png"))); // NOI18N
        jButtonBackup1.setToolTipText("Backup de la base de datos");
        jButtonBackup1.setFocusable(false);
        jButtonBackup1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButtonBackup1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar2.add(jButtonBackup1);

        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gingresos/resources/gif/shutdown.png"))); // NOI18N
        jButton2.setToolTipText("Salir");
        jButton2.setFocusable(false);
        jButton2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });
        jToolBar2.add(jButton2);

        jLabel9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gingresos/resources/gif/dolar.jpg"))); // NOI18N

        javax.swing.GroupLayout jInternalFrameUsuarioLayout = new javax.swing.GroupLayout(jInternalFrameUsuario.getContentPane());
        jInternalFrameUsuario.getContentPane().setLayout(jInternalFrameUsuarioLayout);
        jInternalFrameUsuarioLayout.setHorizontalGroup(
            jInternalFrameUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jInternalFrameUsuarioLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jInternalFrameUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jInternalFrameUsuarioLayout.createSequentialGroup()
                        .addComponent(jToolBar2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(151, 151, 151)
                        .addComponent(jLabel9))
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(140, Short.MAX_VALUE))
        );
        jInternalFrameUsuarioLayout.setVerticalGroup(
            jInternalFrameUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jInternalFrameUsuarioLayout.createSequentialGroup()
                .addGroup(jInternalFrameUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jInternalFrameUsuarioLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jToolBar2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jInternalFrameUsuarioLayout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(33, Short.MAX_VALUE))
        );

        jInternalFrameUsuario.setBounds(140, 610, 460, 240);
        jDesktopPane1.add(jInternalFrameUsuario, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jInternalFrameLogin.setTitle("SISTEMA DE INGRESOS");
        jInternalFrameLogin.setVisible(true);

        jLabel4.setFont(new java.awt.Font("Ubuntu", 0, 24)); // NOI18N
        jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gingresos/resources/gif/dolar.jpg"))); // NOI18N

        jPanel4.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        jLabel2.setText("Usuario");

        jLabel6.setText("Password");

        jTextFieldUsername.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldUsernameActionPerformed(evt);
            }
        });

        jPasswordField1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jPasswordField1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addComponent(jLabel6))
                .addGap(2, 2, 2)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTextFieldUsername, javax.swing.GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE)
                    .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, 266, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jTextFieldUsername, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addGap(26, 26, 26)
                        .addComponent(jLabel6)))
                .addContainerGap(30, Short.MAX_VALUE))
        );

        jLabel7.setText("Version:");

        jLabelVersionNumeroVersion.setText("0.0");

        jButtonEntrar.setText("Entrar");
        jButtonEntrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonEntrarActionPerformed(evt);
            }
        });

        jButtonSalir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gingresos/resources/gif/shutdown.png"))); // NOI18N
        jButtonSalir.setText("Salir");
        jButtonSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonSalirActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel4)
                            .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 416, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(144, 144, 144)
                        .addComponent(jButtonEntrar, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButtonSalir, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(40, 40, 40)
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel7)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabelVersionNumeroVersion, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(51, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(jLabel4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButtonSalir, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)
                    .addComponent(jButtonEntrar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(jLabel5))
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabelVersionNumeroVersion)
                        .addComponent(jLabel7)))
                .addGap(22, 22, 22))
        );

        javax.swing.GroupLayout jInternalFrameLoginLayout = new javax.swing.GroupLayout(jInternalFrameLogin.getContentPane());
        jInternalFrameLogin.getContentPane().setLayout(jInternalFrameLoginLayout);
        jInternalFrameLoginLayout.setHorizontalGroup(
            jInternalFrameLoginLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jInternalFrameLoginLayout.createSequentialGroup()
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jInternalFrameLoginLayout.setVerticalGroup(
            jInternalFrameLoginLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        jInternalFrameLogin.setBounds(180, 50, 490, 300);
        jDesktopPane1.add(jInternalFrameLogin, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jMenuBar1.setEnabled(false);

        jMenuContribuyentes.setText("Contribuyentes");

        jMenuItemContribuyentesRegistros.setText("Registros");
        jMenuItemContribuyentesRegistros.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemContribuyentesRegistrosActionPerformed(evt);
            }
        });
        jMenuContribuyentes.add(jMenuItemContribuyentesRegistros);

        jMenuItemSalir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gingresos/resources/gif/shutdown.png"))); // NOI18N
        jMenuItemSalir.setText("Salir");
        jMenuItemSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemSalirActionPerformed(evt);
            }
        });
        jMenuContribuyentes.add(jMenuItemSalir);

        jMenuBar1.add(jMenuContribuyentes);

        jMenu1.setText("Recibos");

        jMenuItemRecibosReeimprimir.setText("Reeimprimir");
        jMenuItemRecibosReeimprimir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemRecibosReeimprimirActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItemRecibosReeimprimir);

        jMenuBar1.add(jMenu1);

        jMenuContabilidad.setText("Contabilidad");

        jMenuContabilidadIngresos.setText("Ingresos");

        jMenuItemContabilidadIngresosDiarios.setText("Diario");
        jMenuItemContabilidadIngresosDiarios.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemContabilidadIngresosDiariosActionPerformed(evt);
            }
        });
        jMenuContabilidadIngresos.add(jMenuItemContabilidadIngresosDiarios);

        jMenuItemContabilidadInformeDiarioSubgrupo.setText("Subgrupo");
        jMenuItemContabilidadInformeDiarioSubgrupo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemContabilidadInformeDiarioSubgrupoActionPerformed(evt);
            }
        });
        jMenuContabilidadIngresos.add(jMenuItemContabilidadInformeDiarioSubgrupo);

        jMenuItemContabilidadInformeDiarioGrupo.setText("Grupo");
        jMenuItemContabilidadInformeDiarioGrupo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemContabilidadInformeDiarioGrupoActionPerformed(evt);
            }
        });
        jMenuContabilidadIngresos.add(jMenuItemContabilidadInformeDiarioGrupo);

        jMenuItemContabilidadInformeGeneral.setText("General");
        jMenuItemContabilidadInformeGeneral.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemContabilidadInformeGeneralActionPerformed(evt);
            }
        });
        jMenuContabilidadIngresos.add(jMenuItemContabilidadInformeGeneral);

        jMenuContabilidad.add(jMenuContabilidadIngresos);

        jMenuContabilidadMorosidad.setText("Morosidad");

        jMenuItemContabilidadMorosidadListadoComercios.setText("Listado Comercios");
        jMenuItemContabilidadMorosidadListadoComercios.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemContabilidadMorosidadListadoComerciosActionPerformed(evt);
            }
        });
        jMenuContabilidadMorosidad.add(jMenuItemContabilidadMorosidadListadoComercios);

        jMenuItemContabilidadMorosidadListadoContribuyentes.setText("Listado Contribuyentes");
        jMenuItemContabilidadMorosidadListadoContribuyentes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemContabilidadMorosidadListadoContribuyentesActionPerformed(evt);
            }
        });
        jMenuContabilidadMorosidad.add(jMenuItemContabilidadMorosidadListadoContribuyentes);

        jMenuContabilidad.add(jMenuContabilidadMorosidad);

        jMenuBar1.add(jMenuContabilidad);

        jMenuVehiculos.setText("Vehiculos");

        jMenuVehiculosReeimpresion.setText("Reeimpresion");

        jMenuItemVehiculosReempresionCertificacion.setText("Certificacion");
        jMenuItemVehiculosReempresionCertificacion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemVehiculosReempresionCertificacionActionPerformed(evt);
            }
        });
        jMenuVehiculosReeimpresion.add(jMenuItemVehiculosReempresionCertificacion);

        jMenuVehiculos.add(jMenuVehiculosReeimpresion);

        jMenuBar1.add(jMenuVehiculos);

        jMenuAdministracion.setText("Administracion");

        jMenuServidorIngresos.setText("Servidor Ingresos");

        jMenuItemServidorIngresosConsultar.setText("Listar");
        jMenuItemServidorIngresosConsultar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemServidorIngresosConsultarActionPerformed(evt);
            }
        });
        jMenuServidorIngresos.add(jMenuItemServidorIngresosConsultar);

        jMenuItemServidorIngresosConfigurar.setText("Configurar");
        jMenuItemServidorIngresosConfigurar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemServidorIngresosConfigurarActionPerformed(evt);
            }
        });
        jMenuServidorIngresos.add(jMenuItemServidorIngresosConfigurar);

        jMenuAdministracion.add(jMenuServidorIngresos);

        jMenuItemImportarTablasIngreso.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gingresos/resources/gif/mysql.gif"))); // NOI18N
        jMenuItemImportarTablasIngreso.setText("Importar Tablas Ingresos");
        jMenuItemImportarTablasIngreso.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemImportarTablasIngresoActionPerformed(evt);
            }
        });
        jMenuAdministracion.add(jMenuItemImportarTablasIngreso);

        jMenuPresupuestoMain.setText("Importar");

        jMenuRegimenImpositivo.setText("Regimen Impositivo");

        jMenuItemCargarRegimenImpositivo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gingresos/resources/gif/download.png"))); // NOI18N
        jMenuItemCargarRegimenImpositivo.setText("Cargar");
        jMenuItemCargarRegimenImpositivo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemCargarRegimenImpositivoActionPerformed(evt);
            }
        });
        jMenuRegimenImpositivo.add(jMenuItemCargarRegimenImpositivo);

        jMenuGrupoRegimen.setText("Grupo Regimen");

        jMenuItemGrupoRegimenListar.setText("Listar");
        jMenuItemGrupoRegimenListar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemGrupoRegimenListarActionPerformed(evt);
            }
        });
        jMenuGrupoRegimen.add(jMenuItemGrupoRegimenListar);

        jMenuItemGrupoRegimenEliminar.setText("Eliminar");
        jMenuGrupoRegimen.add(jMenuItemGrupoRegimenEliminar);

        jMenuRegimenImpositivo.add(jMenuGrupoRegimen);

        jMenuSubGrupoRegimen.setText("SubGrupo");

        jMenuItemSubGrupoRegimenListar.setText("Listar");
        jMenuItemSubGrupoRegimenListar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemSubGrupoRegimenListarActionPerformed(evt);
            }
        });
        jMenuSubGrupoRegimen.add(jMenuItemSubGrupoRegimenListar);

        jMenuItemSubGrupoRegimenEliminar.setText("Eliminar");
        jMenuSubGrupoRegimen.add(jMenuItemSubGrupoRegimenEliminar);

        jMenuRegimenImpositivo.add(jMenuSubGrupoRegimen);

        jMenuRegimen.setText("Regimen");

        jMenuItemRegimenListar.setText("Listar");
        jMenuItemRegimenListar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemRegimenListarActionPerformed(evt);
            }
        });
        jMenuRegimen.add(jMenuItemRegimenListar);

        jMenuItemRegimenEliminar.setText("Eliminar");
        jMenuRegimen.add(jMenuItemRegimenEliminar);

        jMenuRegimenImpositivo.add(jMenuRegimen);

        jMenuItemDefinirIngresosTributarios.setText("Definir Ingresos Tributarios");
        jMenuItemDefinirIngresosTributarios.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemDefinirIngresosTributariosActionPerformed(evt);
            }
        });
        jMenuRegimenImpositivo.add(jMenuItemDefinirIngresosTributarios);

        jMenuPresupuestoMain.add(jMenuRegimenImpositivo);

        jMenuImportarIngresos.setText("Importar Ingresos");

        jMenuItem22.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gingresos/resources/gif/download.png"))); // NOI18N
        jMenuItem22.setText("Cargar");
        jMenuItem22.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem22ActionPerformed(evt);
            }
        });
        jMenuImportarIngresos.add(jMenuItem22);

        jMenuRecibos.setText("Recibos");

        jMenuItemRecibosListar.setText("Listar");
        jMenuRecibos.add(jMenuItemRecibosListar);

        jMenuImportarIngresos.add(jMenuRecibos);

        jMenuDetallesRecibos.setText("Detalles Recibos");

        jMenuItemDetallesRecibosListar.setText("Listar");
        jMenuDetallesRecibos.add(jMenuItemDetallesRecibosListar);

        jMenuImportarIngresos.add(jMenuDetallesRecibos);

        jMenuPresupuestoMain.add(jMenuImportarIngresos);

        jMenuItemImportarVehiculos.setText("Vehiculos");
        jMenuItemImportarVehiculos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemImportarVehiculosActionPerformed(evt);
            }
        });
        jMenuPresupuestoMain.add(jMenuItemImportarVehiculos);

        jMenuItemImportarContribuyentes.setText("Contribuyentes");
        jMenuItemImportarContribuyentes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemImportarContribuyentesActionPerformed(evt);
            }
        });
        jMenuPresupuestoMain.add(jMenuItemImportarContribuyentes);

        jMenuItemImportarComercios.setText("Comercios");
        jMenuItemImportarComercios.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemImportarComerciosActionPerformed(evt);
            }
        });
        jMenuPresupuestoMain.add(jMenuItemImportarComercios);

        jMenuItemCertificacionVehicular.setText("Certificacion Vehicular");
        jMenuItemCertificacionVehicular.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemCertificacionVehicularActionPerformed(evt);
            }
        });
        jMenuPresupuestoMain.add(jMenuItemCertificacionVehicular);

        jMenuAdministracion.add(jMenuPresupuestoMain);

        jMenuBar1.add(jMenuAdministracion);

        jMenuDevelopment.setText("Development");

        jMenuItemLimpiarTablas.setText("Limpiar Tablas");
        jMenuItemLimpiarTablas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemLimpiarTablasActionPerformed(evt);
            }
        });
        jMenuDevelopment.add(jMenuItemLimpiarTablas);

        jMenuBar1.add(jMenuDevelopment);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jDesktopPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 1519, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jDesktopPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 1006, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jMenuItemServidorIngresosConfigurarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemServidorIngresosConfigurarActionPerformed
        // TODO add your handling code here:
        ServidorIngresosCrear servidorIngresosCrear = new ServidorIngresosCrear();
        servidorIngresosCrear.setVisible(true);
        servidorIngresosCrear.setLocation(x, y);
        jDesktopPane1.add(servidorIngresosCrear);
    }//GEN-LAST:event_jMenuItemServidorIngresosConfigurarActionPerformed

    private void jMenuItemServidorIngresosConsultarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemServidorIngresosConsultarActionPerformed
        // TODO add your handling code here:
        ServidorIngresosListar servidorIngresosListar = new ServidorIngresosListar();
        servidorIngresosListar.setVisible(true);
        servidorIngresosListar.setLocation(x, y);
        jDesktopPane1.add(servidorIngresosListar);
    }//GEN-LAST:event_jMenuItemServidorIngresosConsultarActionPerformed

    private void jMenuItemSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemSalirActionPerformed
        // TODO add your handling code here:
        dataGManager.CloseConnection();
        System.exit(0);
    }//GEN-LAST:event_jMenuItemSalirActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        // TODO add your handling code here:
        System.exit(0);
    }//GEN-LAST:event_jButton2ActionPerformed

private void jTextFieldUsernameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldUsernameActionPerformed
    // TODO add your handling code here:
}//GEN-LAST:event_jTextFieldUsernameActionPerformed

private void jPasswordField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jPasswordField1ActionPerformed
    // TODO add your handling code here:
    Login();
}//GEN-LAST:event_jPasswordField1ActionPerformed

private void jButtonEntrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonEntrarActionPerformed
    // TODO add your handling code here:
    Login();


}//GEN-LAST:event_jButtonEntrarActionPerformed

private void jButtonSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSalirActionPerformed
    // TODO add your handling code here:
    System.exit(0);
}//GEN-LAST:event_jButtonSalirActionPerformed

    private void jButtonUpdateVersion1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonUpdateVersion1ActionPerformed
//        ActualizarSistema actualizarSistema = new ActualizarSistema();
//        actualizarSistema.setVisible(true);
//        jDesktopPane1.add(actualizarSistema);
    }//GEN-LAST:event_jButtonUpdateVersion1ActionPerformed

    private void jMenuItemCargarRegimenImpositivoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemCargarRegimenImpositivoActionPerformed
        CargarRegimenImpositivo cargarRegimenImpositivo = new CargarRegimenImpositivo();
        cargarRegimenImpositivo.setVisible(true);
        cargarRegimenImpositivo.setLocation(x, y);
        jDesktopPane1.add(cargarRegimenImpositivo);
    }//GEN-LAST:event_jMenuItemCargarRegimenImpositivoActionPerformed

    private void jMenuItemGrupoRegimenListarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemGrupoRegimenListarActionPerformed
        GrupoRegimenListar grupoRegimenListar = new GrupoRegimenListar();
        grupoRegimenListar.setVisible(true);
        grupoRegimenListar.setLocation(x, y);
        jDesktopPane1.add(grupoRegimenListar);

    }//GEN-LAST:event_jMenuItemGrupoRegimenListarActionPerformed

    private void jMenuItemSubGrupoRegimenListarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemSubGrupoRegimenListarActionPerformed
        SubgrupoRegimenListar subgrupoRegimenListar = new SubgrupoRegimenListar();
        subgrupoRegimenListar.setVisible(true);
        subgrupoRegimenListar.setLocation(x, y);
        jDesktopPane1.add(subgrupoRegimenListar);
    }//GEN-LAST:event_jMenuItemSubGrupoRegimenListarActionPerformed

    private void jMenuItemRegimenListarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemRegimenListarActionPerformed
        RegimenListar regimenListar = new RegimenListar();
        regimenListar.setVisible(true);
        regimenListar.setLocation(x, y);
        jDesktopPane1.add(regimenListar);
    }//GEN-LAST:event_jMenuItemRegimenListarActionPerformed

    private void jMenuItemDefinirIngresosTributariosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemDefinirIngresosTributariosActionPerformed
        DefinirIngresosTributarios definirIngresosTributarios = new DefinirIngresosTributarios();
        definirIngresosTributarios.setVisible(true);
        definirIngresosTributarios.setLocation(x, y);
        jDesktopPane1.add(definirIngresosTributarios);
    }//GEN-LAST:event_jMenuItemDefinirIngresosTributariosActionPerformed

    private void jMenuItem22ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem22ActionPerformed
        CargarIngresos cargarIngresos = new CargarIngresos();
        cargarIngresos.setVisible(true);
        cargarIngresos.setLocation(x, y);
        jDesktopPane1.add(cargarIngresos);
    }//GEN-LAST:event_jMenuItem22ActionPerformed

    private void jMenuItemImportarTablasIngresoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemImportarTablasIngresoActionPerformed
        ImportarTablas importarTablas = new ImportarTablas();
        importarTablas.setVisible(true);
        importarTablas.setLocation(x, y);
        jDesktopPane1.add(importarTablas);
    }//GEN-LAST:event_jMenuItemImportarTablasIngresoActionPerformed

    private void jMenuItemLimpiarTablasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemLimpiarTablasActionPerformed
        LimpiarTablas limpiarTablas = new LimpiarTablas();
        limpiarTablas.setVisible(true);
        limpiarTablas.setLocation(x, y);
        jDesktopPane1.add(limpiarTablas);
    }//GEN-LAST:event_jMenuItemLimpiarTablasActionPerformed

    private void jMenuItemRecibosReeimprimirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemRecibosReeimprimirActionPerformed
        RecibosReimprimir recibosReimprimir = new RecibosReimprimir();
        recibosReimprimir.setVisible(true);
        recibosReimprimir.setLocation(x, y);
        jDesktopPane1.add(recibosReimprimir);
    }//GEN-LAST:event_jMenuItemRecibosReeimprimirActionPerformed

    private void jMenuItemContabilidadIngresosDiariosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemContabilidadIngresosDiariosActionPerformed
        ContabilidadInformeDiario contabilidadInformeDiario = new ContabilidadInformeDiario();
        contabilidadInformeDiario.setVisible(true);
        contabilidadInformeDiario.setLocation(x, y);
        jDesktopPane1.add(contabilidadInformeDiario);
    }//GEN-LAST:event_jMenuItemContabilidadIngresosDiariosActionPerformed

    private void jMenuItemContabilidadInformeDiarioSubgrupoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemContabilidadInformeDiarioSubgrupoActionPerformed
        ContabilidadInformeDiarioSubGrupo contabilidadInformeSubGrupo = new ContabilidadInformeDiarioSubGrupo();
        contabilidadInformeSubGrupo.setVisible(true);
        contabilidadInformeSubGrupo.setLocation(x, y);
        jDesktopPane1.add(contabilidadInformeSubGrupo);
    }//GEN-LAST:event_jMenuItemContabilidadInformeDiarioSubgrupoActionPerformed

    private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField1ActionPerformed

private void jMenuItemContabilidadInformeDiarioGrupoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemContabilidadInformeDiarioGrupoActionPerformed
    ContabilidadInformeDiarioGrupo contabilidadInformeGrupo = new ContabilidadInformeDiarioGrupo();
    contabilidadInformeGrupo.setVisible(true);
    contabilidadInformeGrupo.setLocation(x, y);
    jDesktopPane1.add(contabilidadInformeGrupo);
}//GEN-LAST:event_jMenuItemContabilidadInformeDiarioGrupoActionPerformed

private void jMenuItemContabilidadInformeGeneralActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemContabilidadInformeGeneralActionPerformed
    ContabilidadInformeGeneral contabilidadInformeGeneral = new ContabilidadInformeGeneral();
    contabilidadInformeGeneral.setVisible(true);
    contabilidadInformeGeneral.setLocation(x, y);
    jDesktopPane1.add(contabilidadInformeGeneral);
}//GEN-LAST:event_jMenuItemContabilidadInformeGeneralActionPerformed

    private void jMenuItemVehiculosReempresionCertificacionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemVehiculosReempresionCertificacionActionPerformed
        VehiculosReeimprimirCertificacion vehiculosReeimprimirCertificacion = new VehiculosReeimprimirCertificacion();
        vehiculosReeimprimirCertificacion.setVisible(true);
        vehiculosReeimprimirCertificacion.setLocation(x, y);
        jDesktopPane1.add(vehiculosReeimprimirCertificacion);

    }//GEN-LAST:event_jMenuItemVehiculosReempresionCertificacionActionPerformed

    private void jMenuItemImportarVehiculosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemImportarVehiculosActionPerformed
        ImportarVehiculos importarVehiculos = new ImportarVehiculos();
        importarVehiculos.setVisible(true);
        importarVehiculos.setLocation(x, y);
        jDesktopPane1.add(importarVehiculos);
    }//GEN-LAST:event_jMenuItemImportarVehiculosActionPerformed

    private void jMenuItemImportarContribuyentesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemImportarContribuyentesActionPerformed
        ImportarContribuyentes importarContribuyentes = new ImportarContribuyentes();
        importarContribuyentes.setVisible(true);
        importarContribuyentes.setLocation(x, y);
        jDesktopPane1.add(importarContribuyentes);
    }//GEN-LAST:event_jMenuItemImportarContribuyentesActionPerformed

    private void jMenuItemImportarComerciosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemImportarComerciosActionPerformed
        ImportarComercios importarComercios = new ImportarComercios();
        importarComercios.setVisible(true);
        importarComercios.setLocation(x, y);
        jDesktopPane1.add(importarComercios);
    }//GEN-LAST:event_jMenuItemImportarComerciosActionPerformed

    private void jMenuItemCertificacionVehicularActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemCertificacionVehicularActionPerformed
        ImportarCertificacionVehicular importarCertificacionVehicular = new ImportarCertificacionVehicular();
        importarCertificacionVehicular.setVisible(true);
        importarCertificacionVehicular.setLocation(x, y);
        jDesktopPane1.add(importarCertificacionVehicular);
    }//GEN-LAST:event_jMenuItemCertificacionVehicularActionPerformed

    private void jMenuItemContabilidadMorosidadListadoComerciosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemContabilidadMorosidadListadoComerciosActionPerformed
MorosidadComerciosListado mcl = new MorosidadComerciosListado();
mcl.setLocation(x, y);
mcl.setVisible(true);
jDesktopPane1.add(mcl);
    }//GEN-LAST:event_jMenuItemContabilidadMorosidadListadoComerciosActionPerformed

    private void jMenuItemContabilidadMorosidadListadoContribuyentesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemContabilidadMorosidadListadoContribuyentesActionPerformed
MorosidadContribuyentesListado mcl = new MorosidadContribuyentesListado();
mcl.setLocation(x, y);
mcl.setVisible(true);
jDesktopPane1.add(mcl);
    }//GEN-LAST:event_jMenuItemContabilidadMorosidadListadoContribuyentesActionPerformed

    private void jMenuItemContribuyentesRegistrosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemContribuyentesRegistrosActionPerformed
       ContribuyentesRegistros cr = new ContribuyentesRegistros();
       cr.setLocation(x, y);
       cr.setVisible(true);
       jDesktopPane1.add(cr);
    }//GEN-LAST:event_jMenuItemContribuyentesRegistrosActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new MenuForm().setVisible(true);
            }
        });
    }

    private void Login() {
        try {
            usuarios1.setUsername(jTextFieldUsername.getText());
            String password = new String(this.jPasswordField1.getPassword());
            String passworddb = "";

            MySesion.setUsername(jTextFieldUsername.getText());

            Usuarios usuarios = usuariosController1.findByPrimaryKey(usuarios1);
            if (usuarios == null) {
                Mensajeria.Mensaje(" No existe un usuario con ese username");
                return;
            } else {
                usuarios1 = usuarios;
                passworddb = encriptador.decrypt(usuarios1.getPassword());
                if (!passworddb.equals(password)) {
                    Mensajeria.Mensaje("El password no es correcto");
                    return;
                }
                String dbActivo = usuarios1.getActivo();
                dbActivo = dbActivo.toLowerCase();
                if (!dbActivo.equals("si")) {
                    Mensajeria.Mensaje("Este usario no esta activo para usar el sistema");
                    return;
                }
//                splash.showSplashAndExit("Bienvenido "+ usuario1.getUsuario());
                MySesion.setIdmunicipio(usuarios1.getIdmunicipio());
                MySesion.setIdpatrono("");
                MySesion.setNombreusuario(usuarios1.getUsuario());

                Municipios municipios = new Municipios();
                municipios.setIdmunicipio(usuarios1.getIdmunicipio());
                MunicipiosController mc = new MunicipiosController();
                if (mc.findByIdmunicipio(municipios)) {
                    MySesion.setMunicipio(mc.getMunicipioslist().get(0).getMunicipio());
                }




                // verificar los privilegios
                menuBeans1.ActivarTodos();
                jMenuBar1.setEnabled(true);
                jMenuBar1.setVisible(true);
                jInternalFrameLogin.setVisible(false);
                jInternalFrameUsuario.setVisible(true);

                jLabelUsername.setText(MySesion.getNombreusuario());

                jLabelIdMunicipio.setText(MySesion.getMunicipio() + " : " + MySesion.getIdmunicipio());
                jLabelVersionNumeroVersionUsuario.setText(MySesion.getVersion());

            }
        } catch (Exception ex) {
            Mensajeria.MensajeError(ex, "botonEntrar()");
        }
    }

    class IconPolice implements VetoableChangeListener {

        public void vetoableChange(PropertyChangeEvent ev)
                throws PropertyVetoException {
            String name = ev.getPropertyName();
            if (name.equals(JInternalFrame.IS_ICON_PROPERTY)
                    && (ev.getNewValue() == Boolean.TRUE)) {
                JInternalFrame[] frames = jDesktopPane1.getAllFrames();
                int count = frames.length;
                int nonicons = 0; // how many are not icons?
                for (int i = 0; i < count; i++) {
                    if (!frames[i].isIcon()) {
                        nonicons++;
                    }
                }
                if (nonicons <= 1) {
                    throw new PropertyVetoException("Invalid Iconification!",
                            ev);
                }
            }
        }
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButtonBackup1;
    private javax.swing.JButton jButtonEntrar;
    private javax.swing.JButton jButtonSalir;
    private javax.swing.JButton jButtonUpdateVersion1;
    private javax.swing.JDesktopPane jDesktopPane1;
    private javax.swing.JInternalFrame jInternalFrameLogin;
    private javax.swing.JInternalFrame jInternalFrameUsuario;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel jLabelIdMunicipio;
    private javax.swing.JLabel jLabelUsername;
    private javax.swing.JLabel jLabelVersionNumeroVersion;
    private javax.swing.JLabel jLabelVersionNumeroVersionUsuario;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenuAdministracion;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenu jMenuContabilidad;
    private javax.swing.JMenu jMenuContabilidadIngresos;
    private javax.swing.JMenu jMenuContabilidadMorosidad;
    private javax.swing.JMenu jMenuContribuyentes;
    private javax.swing.JMenu jMenuDetallesRecibos;
    private javax.swing.JMenu jMenuDevelopment;
    private javax.swing.JMenu jMenuGrupoRegimen;
    private javax.swing.JMenu jMenuImportarIngresos;
    private javax.swing.JMenuItem jMenuItem22;
    private javax.swing.JMenuItem jMenuItemCargarRegimenImpositivo;
    private javax.swing.JMenuItem jMenuItemCertificacionVehicular;
    private javax.swing.JMenuItem jMenuItemContabilidadInformeDiarioGrupo;
    private javax.swing.JMenuItem jMenuItemContabilidadInformeDiarioSubgrupo;
    private javax.swing.JMenuItem jMenuItemContabilidadInformeGeneral;
    private javax.swing.JMenuItem jMenuItemContabilidadIngresosDiarios;
    private javax.swing.JMenuItem jMenuItemContabilidadMorosidadListadoComercios;
    private javax.swing.JMenuItem jMenuItemContabilidadMorosidadListadoContribuyentes;
    private javax.swing.JMenuItem jMenuItemContribuyentesRegistros;
    private javax.swing.JMenuItem jMenuItemDefinirIngresosTributarios;
    private javax.swing.JMenuItem jMenuItemDetallesRecibosListar;
    private javax.swing.JMenuItem jMenuItemGrupoRegimenEliminar;
    private javax.swing.JMenuItem jMenuItemGrupoRegimenListar;
    private javax.swing.JMenuItem jMenuItemImportarComercios;
    private javax.swing.JMenuItem jMenuItemImportarContribuyentes;
    private javax.swing.JMenuItem jMenuItemImportarTablasIngreso;
    private javax.swing.JMenuItem jMenuItemImportarVehiculos;
    private javax.swing.JMenuItem jMenuItemLimpiarTablas;
    private javax.swing.JMenuItem jMenuItemRecibosListar;
    private javax.swing.JMenuItem jMenuItemRecibosReeimprimir;
    private javax.swing.JMenuItem jMenuItemRegimenEliminar;
    private javax.swing.JMenuItem jMenuItemRegimenListar;
    private javax.swing.JMenuItem jMenuItemSalir;
    private javax.swing.JMenuItem jMenuItemServidorIngresosConfigurar;
    private javax.swing.JMenuItem jMenuItemServidorIngresosConsultar;
    private javax.swing.JMenuItem jMenuItemSubGrupoRegimenEliminar;
    private javax.swing.JMenuItem jMenuItemSubGrupoRegimenListar;
    private javax.swing.JMenuItem jMenuItemVehiculosReempresionCertificacion;
    private javax.swing.JMenu jMenuPresupuestoMain;
    private javax.swing.JMenu jMenuRecibos;
    private javax.swing.JMenu jMenuRegimen;
    private javax.swing.JMenu jMenuRegimenImpositivo;
    private javax.swing.JMenu jMenuServidorIngresos;
    private javax.swing.JMenu jMenuSubGrupoRegimen;
    private javax.swing.JMenu jMenuVehiculos;
    private javax.swing.JMenu jMenuVehiculosReeimpresion;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPasswordField jPasswordField1;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextFieldUsername;
    private javax.swing.JToolBar jToolBar2;
    // End of variables declaration//GEN-END:variables
}
